<!DOCTYPE html>
<html>
  <head>
    <title>JSTest7.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <script type="text/javascript">
    	window.onload = function(){
    		var str1 = "^^abc";
    		//正则表达式  g表示全局 ^表示以什么开始  ^是特殊字符 所以要加\  {2}表示^数量为2
    		//以两个^开头的全局变量
    		var reg = /^\^{2}/g;
    		var str2 = "abc";
    		
    		//test() 方法用于检测一个字符串是否匹配某个模式.
    		alert(reg.test(str1));//true
    		alert(reg.test(str2));//false
    		
    		str1 = str1.replace(reg,"");//替换
    		alert(str1);//abc
    	}
    </script>

  </head>
  
  <body>
	<p>Which city do you like to live?</p>
  	<ul id="city">
  		<li id="beijing">BeiJing</li>
  		<li id="shanghai">ShangHai</li>
  		<li id="guangzhou">GuangZhou</li>
  	</ul>
  </body>
</html>
